package com.iplant.wms.service.po.batch;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;
import com.iplant.wms.service.basicenum.mss.MSSBatchPropControlType;

import java.io.Serializable;

/**
 * 批次属性
 */
@DBBasePO(TableName ="mss_batchprop" ,CheckName = {"Code,RuleID","RuleID,Name"},Schemas = DBSchemas.WMS,CodeAuto = true,CodePrefix = "PCSX-")
public class MSSBatchProp extends BasePO implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 规则
     */
    @DBCondition
    @DBField
    public int RuleID = 0;

    @DBCondition
    @DBJoin(name = "Code",tableName = "mss_batchrule", tableAsName = "p1",
            Schemas = DBSchemas.WMS,MainTableField ="RuleID")
    public String RuleCode = "";
    @DBJoin(name = "Name",tableName = "mss_batchrule", tableAsName = "p1",
            Schemas = DBSchemas.WMS,MainTableField ="RuleID")
    public String RuleName = "";

    @DBCondition
    @DBField
    public int  PropType= 0;

    public String  PropTypeText= "";

    /**
     * 是否显示在标签中
     */
    @DBField
    public int VisibleRF = 0;


    /**
     * 数据类型  1字符 2数字 3日期
     */
    @DBField
    public int DataType = 0;

    /**
     * 使用/分隔
     */
    @DBField
    public String DataOptions = "";

    /**
     * 数据是否检查
     */
    @DBField
    public int DataCheck = 0;


    @JsonProperty("RuleID")
    public int getRuleID() {
        return RuleID;
    }

    public void setRuleID(int ruleID) {
        RuleID = ruleID;
    }

    @JsonProperty("RuleCode")
    public String getRuleCode() {
        return RuleCode;
    }

    public void setRuleCode(String ruleCode) {
        RuleCode = ruleCode;
    }

    @JsonProperty("RuleName")
    public String getRuleName() {
        return RuleName;
    }

    public void setRuleName(String ruleName) {
        RuleName = ruleName;
    }



    @JsonProperty("VisibleRF")
    public int getVisibleRF() {
        return VisibleRF;
    }

    public void setVisibleRF(int visibleRF) {
        VisibleRF = visibleRF;
    }

    @JsonProperty("DataType")
    public int getDataType() {
        return DataType;
    }

    public void setDataType(int dataType) {
        DataType = dataType;
    }

    @JsonProperty("DataOptions")
    public String getDataOptions() {
        return DataOptions;
    }

    public void setDataOptions(String dataOptions) {
        DataOptions = dataOptions;
    }

    @JsonProperty("DataCheck")
    public int getDataCheck() {
        return DataCheck;
    }

    public void setDataCheck(int dataCheck) {
        DataCheck = dataCheck;
    }
    @JsonProperty("PropType")
    public int getPropType() {
        return PropType;
    }

    public void setPropType(int propType) {
        PropType = propType;
    }
    @JsonProperty("PropTypeText")
    public String getPropTypeText() {
        PropTypeText= MSSBatchPropControlType.getEnumType(PropType).getLabel();
        return PropTypeText;
    }

    public void setPropTypeText(String propTypeText) {
        PropTypeText = propTypeText;
    }
}
